import React from "react";
import './style.scss'

const Index = ({ product, onClick, isActive = false }) => {
  return (
    <div className={ isActive ? 'list-item active': 'list-item' } onClick={onClick}>
      <div className="img">
        <img src={product.image} alt="" />
      </div>
      <div className="content">
        <h5>{product.name}</h5>

        <div className="tag">
          {product.productExtInfo.sellPoint.map((v, i) => {
            return <span key={i}>满功耗独显</span>;
          })}
        </div>

        { product.productExtInfo.promoTagDet1 &&  <div className="tag1">{product.productExtInfo.promoTagDet1}</div>}

        <p className="price">${product.pPrice}</p>
        <div className="BusCard-dq4">
          <div className="dq4-good">{product.goodRate}</div>
          <div className="dq4-text">好评力荐</div>
        </div>
      </div>
    </div>
  );
};

export default Index;
